package com.css.zfzx.sjcj.modules.hddcB1GeologySvyProjectTable.service.impl;

import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult;
import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
import com.css.bpm.platform.utils.PlatformObjectUtils;
import com.css.zfzx.sjcj.common.excel.util.ActiveFaultEasyExcelVerifyHelper;
import com.css.zfzx.sjcj.modules.hddcB1GeologySvyProjectTable.viewobjects.HddcB1GeologysvyprojecttableVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * <p>地质调查数据-地质调查工程表-属性表管理, Excel导入校验器</p>
 *
 * @author liuhy
 * @date 2021/8/30
 */
@Component
public class GeologySurveyProjectTableExcelVerifyHandler implements IExcelVerifyHandler<HddcB1GeologysvyprojecttableVO> {

    private final ActiveFaultEasyExcelVerifyHelper helper;

    @Autowired
    public GeologySurveyProjectTableExcelVerifyHandler(ActiveFaultEasyExcelVerifyHelper helper) {
        this.helper = helper;
    }

    @Override
    public ExcelVerifyHandlerResult verifyHandler(HddcB1GeologysvyprojecttableVO vo) {
        ExcelVerifyHandlerResult result = helper.verify(vo);
        if (PlatformObjectUtils.isEmpty(vo.getName())) {
            helper.writeNotNullMsg(result, "工程名称");
        }
        return result;
    }

}
